/*
 * @Author: windys
 * @Description: 
 * @Date: 2022-02-11 15:32:26
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const postCssPxToRem = require("postcss-pxtorem")  //移动端适配
import styleImport, { VantResolve } from 'vite-plugin-style-import'; //按需组件
import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
  base: './',
  plugins: [
    vue(),
    styleImport({
      resolves: [VantResolve()],
    }),
  ],
  publicDir:"public",
  server: {
    open:true,
    host: '192.168.10.139',
    port: 3000,
    // 是否开启 https
    https: false,
  },
  resolve:{
    alias: {
      "@": path.resolve(__dirname, "src"),
    },
  },
  css: {
    postcss: {
      plugins: [
        postCssPxToRem({
          rootValue: 37.5, // 1rem的大小
          propList: ['*'], // 需要转换的属性，这里选择全部都进行转换
        })
      ]
    }
  }
})
